#include<iostream>
#include<string>
#include<cstdio>
#include<unordered_map>
using namespace std;
typedef long long LL;
const int N = 1e7 + 10;
unordered_map<LL, bool>mp;
int n;
int main()
{
	scanf("%d", &n);
	/*if (n == 1) {
		cout << 1 << endl;
		return 0;
	}*/
	int x = (n + 1) / 2;
	LL ans = 0;
	for (int i = 1; i <= x; i++) {
		for (int j = i - 1; j >=0 ; j--) {
			LL a = (LL)i * i - (LL)j * j;
			if (a <= n) {
				if (!mp[a]) {
					mp[a] = 1;
					ans++;
					//cout << "i==" << i << "  j==" << j << endl;
					//cout << "a==" << a << endl;
				}
			}
			else break;
		}
	}
	printf("%lld\n", ans);
	return 0;
}